<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购物车 - 电商网站</title>
    <style>
        /* 基础样式 */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }
        
        header {
            background-color: #333;
            color: white;
            padding: 20px 0;
        }
        
        nav ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            gap: 20px;
        }
        
        nav ul li {
            cursor: pointer;
        }
        
        main {
            padding: 40px 0;
        }
        
        .cart-container {
            display: flex;
            gap: 20px;
        }
        
        .cart-items {
            flex: 2;
        }
        
        .cart-item {
            display: flex;
            gap: 20px;
            border-bottom: 1px solid #ddd;
            padding: 10px 0;
        }
        
        .item-image img {
            max-width: 100px;
            height: auto;
        }
        
        .item-details {
            flex: 1;
        }
        
        .item-description {
            color: #666;
            font-size: 0.9em;
            margin: 5px 0;
        }
        
        .item-spec {
            color: #666;
            font-size: 0.9em;
            margin: 5px 0;
        }
        
        .item-price {
            font-weight: bold;
        }
        
        .item-quantity {
            margin: 5px 0;
        }
        
        .item-total {
            font-weight: bold;
            color: #e4393c;
        }
        
        .remove-item {
            color: #e4393c;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
            margin-top: 10px;
        }
        
        .cart-summary {
            flex: 1;
            border: 1px solid #ddd;
            padding: 20px;
            height: fit-content;
        }
        
        .summary-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
        }
        
        .total {
            font-weight: bold;
            border-top: 1px solid #ddd;
            padding-top: 10px;
        }
        
        .checkout-btn {
            width: 100%;
            margin-top: 20px;
        }
        
        .toast {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background-color: #333;
            color: white;
            padding: 10px 20px;
            border-radius: 5px;
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 1000;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <header>
        <div class="container">
            <h1 class="logo">电商网站</h1>
            <nav>
                <ul>
                    <li><a href="index.html">首页</a></li>
                    <li><a href="#" id="login-link">登录</a></li>
                    <li><a href="register.html">注册</a></li>
                    <li><a href="cart.html">购物车 (<span id="cart-count">0</span>)</a></li>
                    <li><a href="profile.html" style="display: none;">我的账户</a></li>
                </ul>
            </nav>
        </div>
    </header>

    <main class="container">
        <h1>我的购物车</h1>
        <div class="cart-container">
            <div class="cart-items" id="cart-items">
                <!-- 购物车商品将通过JavaScript动态加载 -->
            </div>
            <div class="cart-summary">
                <h2>订单摘要</h2>
                <div class="summary-row">
                    <span>商品总数:</span>
                    <span id="total-items">0</span>
                </div>
                <div class="summary-row">
                    <span>商品总价:</span>
                    <span id="subtotal">¥0.00</span>
                </div>
                <div class="summary-row">
                    <span>运费:</span>
                    <span id="shipping">¥0.00</span>
                </div>
                <div class="summary-row total">
                    <span>总计:</span>
                    <span id="total">¥0.00</span>
                </div>
                <button id="checkout-btn" class="checkout-btn">去结算</button>
                <p class="checkout-tip">结算后您可以选择支付方式并确认收货信息。</p>
            </div>
        </div>
    </main>

    <footer>
        <div class="container">
            <p>&copy; 2023 电商网站. 保留所有权利.</p>
        </div>
    </footer>

    <script src="js/cart.js"></script>
</body>
</html>